Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​ComponentModel.​BindingList<​T>

Assembly: System.ComponentModel.TypeConverter

Inheritance: object → Collections.​ObjectModel.​Collection<​T> → BindingList

Implemented Interfaces

Provides a generic collection that supports data binding.

Properties

public bool
AllowEdit
Gets or sets a value indicating whether items in the list can be edited.
public bool
AllowNew
Gets or sets a value indicating whether you can add items to the list using the <see cref="M:System.ComponentModel.BindingList`1.AddNew" /> method.
public bool
AllowRemove
Gets or sets a value indicating whether you can remove items from the collection.
protected bool
IsSortedCore
Gets a value indicating whether the list is sorted.
public bool
RaiseListChangedEvents
Gets or sets a value indicating whether adding or removing items within the list raises <see cref="E:System.ComponentModel.BindingList`1.ListChanged" /> events.
protected ListSortDirection
SortDirectionCore
Gets the direction the list is sorted.
protected PropertyDescriptor
SortPropertyCore
Gets the property descriptor that is used for sorting the list if sorting is implemented in a derived class; otherwise, returns <see langword="null" /> .
protected bool
SupportsChangeNotificationCore
Gets a value indicating whether <see cref="E:System.ComponentModel.BindingList`1.ListChanged" /> events are enabled.
protected bool
SupportsSearchingCore
Gets a value indicating whether the list supports searching.
protected bool
SupportsSortingCore
Gets a value indicating whether the list supports sorting.
public int
Count
public T
Item
Items

Methods

public T
AddNew​()
Adds a new item to the collection.
Returns The item added to the list.
protected object
AddNewCore​()
Adds a new item to the end of the collection.
Returns The item that was added to the collection.
protected void
ApplySortCore​(PropertyDescriptor prop, ListSortDirection direction)
Sorts the items if overridden in a derived class; otherwise, throws a <see cref="T:System.NotSupportedException" /> .
prop A <see cref="T:System.ComponentModel.PropertyDescriptor" /> that specifies the property to sort on.
direction One of the <see cref="T:System.ComponentModel.ListSortDirection" /> values.
public void
CancelNew​(int itemIndex)
Discards a pending new item.
itemIndex The index of the of the new item to be added.
protected void
ClearItems​()
Removes all elements from the collection.
public void
EndNew​(int itemIndex)
Commits a pending new item to the collection.
itemIndex The index of the new item to be added.
protected int
FindCore​(PropertyDescriptor prop, object key)
Searches for the index of the item that has the specified property descriptor with the specified value, if searching is implemented in a derived class; otherwise, a <see cref="T:System.NotSupportedException" /> .
Returns The zero-based index of the item that matches the property descriptor and contains the specified value.
prop The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to search for.
key The value of <paramref name="prop" /> to match.
protected void
InsertItem​(int index, T item)
Inserts the specified item in the list at the specified index.
index The zero-based index where the item is to be inserted.
item The item to insert in the list.
protected void
OnAddingNew​(AddingNewEventArgs e)
Raises the <see cref="E:System.ComponentModel.BindingList`1.AddingNew" /> event.
e An <see cref="T:System.ComponentModel.AddingNewEventArgs" /> that contains the event data.
protected void
OnListChanged​(ListChangedEventArgs e)
Raises the <see cref="E:System.ComponentModel.BindingList`1.ListChanged" /> event.
e A <see cref="T:System.ComponentModel.ListChangedEventArgs" /> that contains the event data.
protected void
RemoveItem​(int index)
Removes the item at the specified index.
index The zero-based index of the item to remove.
protected void
RemoveSortCore​()
Removes any sort applied with <see cref="M:System.ComponentModel.BindingList`1.ApplySortCore(System.ComponentModel.PropertyDescriptor,System.ComponentModel.ListSortDirection)" /> if sorting is implemented in a derived class; otherwise, raises <see cref="T:System.NotSupportedException" /> .
public void
ResetBindings​()
Raises a <see cref="E:System.ComponentModel.BindingList`1.ListChanged" /> event of type <see cref="F:System.ComponentModel.ListChangedType.Reset" /> .
public void
ResetItem​(int position)
Raises a <see cref="E:System.ComponentModel.BindingList`1.ListChanged" /> event of type <see cref="F:System.ComponentModel.ListChangedType.ItemChanged" /> for the item at the specified position.
position A zero-based index of the item to be reset.
protected void
SetItem​(int index, T item)
Replaces the item at the specified index with the specified item.
index The zero-based index of the item to replace.
item The new value for the item at the specified index. The value can be <see langword="null" /> for reference types.
public void
Add​(T item)
public void
Clear​()
public bool
Contains​(T item)
public void
CopyTo​(T[] array, int index)
GetEnumerator​()
public int
IndexOf​(T item)
public void
Insert​(int index, T item)
public bool
Remove​(T item)
public void
RemoveAt​(int index)
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object